package com.maimang.platform.dsp.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.maimang.platform.dsp.mapper.AdvertiserIdsMapper;
import com.maimang.platform.dsp.entity.AdvertiserIds;
import com.maimang.platform.dsp.service.AdvertiserIdsService;
import com.maimang.platform.lang.ConvertUtils;

/**
 * @classname AdvertiserIdsServiceImpl
 * @description <br>广告主列服务层实现类</br>
 * @author  Rocky
 * @date    2019-11-01 11:36:12
 * @email   jintaozhao@qq.com
 * @version 1.0.0
 */
@Service
public class AdvertiserIdsServiceImpl implements AdvertiserIdsService {

	@Autowired
	private AdvertiserIdsMapper advertiserIdsMapper;

	/**
     * 查询广告主列信息
     * 
     * @param id 广告主列ID
     * @return 广告主列信息
     */
    @Override
	public AdvertiserIds selectAdvertiserIdsById(Long id) {
	    return advertiserIdsMapper.selectAdvertiserIdsById(id);
	}
	
	/**
     * 查询广告主列列表
     * 
     * @param advertiserIds 广告主列信息
     * @return 广告主列集合
     */
	@Override
	public List<AdvertiserIds> selectAdvertiserIdsList(AdvertiserIds advertiserIds) {
	    return advertiserIdsMapper.selectAdvertiserIdsList(advertiserIds);
	}

	/**
	 * 查询所有广告主id列表
	 *
	 * @param advertiserId 代理商广告主id
	 * @return
	 */
	@Override
	public List<AdvertiserIds> selectAdvertiserIds(Long advertiserId) {
		AdvertiserIds base = new AdvertiserIds();
		base.setPId(advertiserId);
		List<AdvertiserIds> advertiserIdsList = advertiserIdsMapper.selectAdvertiserIdsList(base);
		return advertiserIdsList;
	}

	/**
     * 新增广告主列
     * 
     * @param advertiserIds 广告主列信息
     * @return 结果
     */
	@Override
	public int insertAdvertiserIds(AdvertiserIds advertiserIds) {
	    return advertiserIdsMapper.insertAdvertiserIds(advertiserIds);
	}
	
	/**
     * 修改广告主列
     * 
     * @param advertiserIds 广告主列信息
     * @return 结果
     */
	@Override
	public int updateAdvertiserIds(AdvertiserIds advertiserIds) {
	    return advertiserIdsMapper.updateAdvertiserIds(advertiserIds);
	}

	/**
     * 删除广告主列对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteAdvertiserIdsByIds(String ids) {
		return advertiserIdsMapper.deleteAdvertiserIdsByIds(ConvertUtils.toStrArray(ids));
	}
	
}